package JTools;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

// Combines CharacterPane next to a JList.
public class TestCompositePanel extends JPanel {
	JList list;
	JLabel label;
	public TestCompositePanel() {
		
		setLayout(new BorderLayout());
	
		String[] styfff = {"Hi", " hi" , "hi" , "hi"};
		JList lv = new JList(styfff);
		JScrollPane scroller = new JScrollPane();
		lv.setVisible(true);
		scroller.setPreferredSize(new Dimension(250, 200));
		scroller.getViewport().add(lv);
		add(scroller, BorderLayout.WEST);
		add(new CharacterPane(), BorderLayout.EAST);
		
		/*
		 this.setLayout(new BorderLayout());
	        this.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));

	        GraphicsEnvironment ge =
	            GraphicsEnvironment.getLocalGraphicsEnvironment();

	        String[] fonts = ge.getAvailableFontFamilyNames();

	        list = new JList(fonts);
	        list.addListSelectionListener(new ListSelectionListener() {
	            @Override
	            public void valueChanged(ListSelectionEvent e) {
	                if (!e.getValueIsAdjusting()) {
	                    String name = (String) list.getSelectedValue();
	                    Font font = new Font(name, Font.PLAIN, 12);
	                    label.setFont(font);
	                }
	            }
	        });

	        JScrollPane pane = new JScrollPane();
	        pane.getViewport().add(list);
	        pane.setPreferredSize(new Dimension(250, 200));
	        this.add(pane);

	        label = new JLabel("Aguirre, der Zorn Gottes");
	        label.setFont(new Font("Serif", Font.PLAIN, 12));
	        add(label, BorderLayout.SOUTH);
		*/
	}
}
